/*
      file: urlparser.h
      desc: parse a html page, get each url and its link text
      author: chen hua
      create: 2005-03-16
*/
#ifndef _URL_PARSER_H_
#define _URL_PARSER_H_

#include "basehtmlparser.h"
#include <map>
#include <string>
using namespace std;

class CURLParser: public CBaseHtmlParser
{
public:
    CURLParser()
    {
        m_bInTagA = false;
    }
    bool Parse( const string &URL, const string &Content );

public:
    map<string, string> m_URL2Text;

private:
    bool m_bInTagA;
    string m_strCurURL;
    void OnStartTag( const SZ_STRING &strTagName, vector< pair<SZ_STRING, SZ_STRING> > Attribs );
    void OnEndTag( const SZ_STRING &strTagName );
    void OnData( const SZ_STRING &strData );
};

#endif




